Skip to content

Conversation

lightclient
Copy link
Member

@lightclient lightclient commented Jul 18, 2025

Will probably be mostly supplanted by #32224, but this should do for now for devnet 3.

Seems like #32224 is going to take some more time, so I have completed the implementation of eth_config here. It is quite a bit simpler to implement now that the config hashing was removed.

params/config.go Outdated

switch {
case c.IsOsaka(london, time):
next = c.OsakaTime
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to return something like Maxuint64 here

@lightclient
Copy link
Member Author

Implementation seems correct now, working on some tests.

@lightclient
Copy link
Member Author

Should be ready to go, PTAL!

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, small nit

@lightclient lightclient changed the title Add eth_config internal/ethapi,params: add eth_config Aug 27, 2025
}
forkid := forkid.NewID(c, types.NewBlockWithHeader(genesis), ^uint64(0), t).Hash
return &config{
ActivationTime: t,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Activation time is required. If a fork is activated at genesis the value 0 is used. If the fork is not scheduled to be activated or its activation time is unknown it should not be in the rpc results.

Fix like this?

diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index eb662f9a71..9f2e84c194 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -1188,9 +1188,14 @@ func (api *BlockChainAPI) Config(ctx context.Context) (*configResponse, error) {
 		for addr, c := range vm.ActivePrecompiledContracts(rules) {
 			precompiles[c.Name()] = addr
 		}
+		// Activation time is required. If a fork is activated at genesis the value 0 is used
+		activateTime := t
+		if genesis.Time >= t {
+			activateTime = 0
+		}
 		forkid := forkid.NewID(c, types.NewBlockWithHeader(genesis), ^uint64(0), t).Hash
 		return &config{
-			ActivationTime:  t,
+			ActivationTime:  activateTime,
 			BlobSchedule:    c.BlobConfig(c.LatestFork(t)),
 			ChainId:         (*hexutil.Big)(c.ChainID),
 			ForkId:          forkid[:],

@rjl493456442
Copy link
Member

One nit, otherwise lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants